package com.fly.hbn.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fly.hbn.dao.CustomerDao;
import com.fly.hbn.model.Customer;
import com.fly.hbn.service.CustomerService;

@Service
@Transactional
public class CustomerServiceImpl implements CustomerService
{
    @Autowired
    CustomerDao customerDao;
    
    /**
     * @return
     */
    @Override
    public List<Customer> getAllCustomers()
    {
        return customerDao.getAllCustomers();
    }
    
    /**
     * @param id
     * @return
     */
    @Override
    public Customer getCustomer(int id)
    {
        return customerDao.getCustomer(id);
    }
    
    /**
     * @param customer
     */
    @Override
    public void addCustomer(Customer customer)
    {
        customerDao.addCustomer(customer);
    }
    
    /**
     * @param customer
     */
    @Override
    public void updateCustomer(Customer customer)
    {
        customerDao.updateCustomer(customer);
    }
    
    /**
     * @param id
     */
    @Override
    @Transactional
    public void deleteCustomer(int id)
    {
        customerDao.deleteCustomer(id);
    }
}
